
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.LinkedList;





public class Connections extends Thread {
ObjectInputStream input;
OutputStream output;
Socket socket;	
String IP;
boolean message=false;
LinkedList<Object> serverMsgList;
	
public Connections(Socket socket, String Ip, LinkedList<Object> serverMsgList){
	this.socket=socket;
	this.IP=Ip;
	this.serverMsgList=serverMsgList;
}
public String getIP(){
	return IP;
}

public Socket getSocket(){
	return socket;
}

public void run(){
	while(true){
	try{
	input = new ObjectInputStream( socket.getInputStream());
	message = true;
	serverMsgList.add(input);
	}catch(Exception e){
	System.out.println("error in thread Connections");
	}
}
}
public boolean anyMessage(){
	return message;
}

}